import proFetch from '../../../../hrpub/common/utils/project-fetch';



export default{
    name: 'main',
    data: {
        json: {}, //多语文件
        showPage: 'list', //默认显示列表页面 card 代表卡片界面
        type: '1', // 默认页面为入职 '2'代表离职界面
        cardstatus: 'browse', //卡片界面状态 默认浏览态 edit 代表编辑态
        orgvalue: '', //默认组织
        pageInfo: {
            pageIndex: 1,
            pageSize: 10,
            total: 0,
            totalPage: 1
        }  //分页信息


    },

    sync: {
        update(state,payload){
            return {
                ...state,
                ...payload
            }
        }
    },

    async: {
        //获取表格数据
        getTableData(disaptch,getstate,data){
            return proFetch({
                url: '/nccloud/hrtrn/handcond/HandCondQueryAction.do',
                body: data
            })
        },

        //获取卡片界面模版
        add(disaptch,getstate,data){
            return proFetch({
                url: '/nccloud/hrtrn/handcond/HandCondAddAction.do',
                body: data
            })
        },

        //删除表格数据
        delTableData(dispatch,getstate,data){
            return proFetch({
                url: '/nccloud/hrtrn/handcond/HandCondDelAction.do',
                body: data
            })
        },

        //获取卡片界面数据
        getFormValue(disaptch,getstate,data){
            return proFetch({
                url: '/nccloud/hrtrn/handcond/HandCondEditAction.do',
                body: data
            })
        }
        
    }

}